﻿// =================================================================== 
// 项目说明
//====================================================================
// @Copy Right 2006-2008
// 文件： T_SPECIALLIST.cs
// 项目名称：Lovol 
// 创建时间：2011/8/18
// 负责人：
// ===================================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Web;
using System.Web.UI;
using DP.Web;
using DP.Common;
using DP.Data.OracleClient;
using DP.Data.Common;

using CRM.Entity;

namespace CRM.BLL
{
    /// <summary>
    /// 业务层实例类 SA.T_SPECIALLIST.
    /// </summary>
    public partial class T_SPECIALLIST_BLL
    {		
		#region 成员
		///<summary>
		/// 数据访问层 接口对象
		///</summary>
		public readonly DAL<T_SPECIALLIST_Entity> _dal= DALFactory.CreateDal<T_SPECIALLIST_Entity>();
		#endregion
		
		#region 构造函数
		/// <summary>
		/// 构造函数
		/// </summary>
		public T_SPECIALLIST_BLL()
		{
		}
		#endregion

        #region 实例化函数
		
		#region 添加
		/// <summary>
		/// 向数据库中插入一条新记录。
		/// </summary>
		/// <param name="_T_SPECIALLIST_Entity">T_SPECIALLIST实体</param>
		/// <returns>影响的行数</returns>
		public long Insert(T_SPECIALLIST_Entity entity)
		{
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Insert(entity);
				
		}
		#endregion
		
		#region 更新
		
		/// <summary>
		/// 向数据表T_SPECIALLIST更新一条记录。
		/// </summary>
		/// <param name="_T_SPECIALLIST_Entity">entity</param>
		/// <returns>影响的行数</returns>
		public int Update(T_SPECIALLIST_Entity entity)
		{
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Update(entity);
			
		}
		/// <summary>
		/// 向数据表T_SPECIALLIST更新一条记录。
		/// </summary>
		/// <param name="_T_SPECIALLIST_Entity">entity</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>影响的行数</returns>
		public int Update(T_SPECIALLIST_Entity entity, StringBuilder partitionName)
		{
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Update(entity, partitionName);
			
		}
		#endregion 
		
		#region 删除
		/// <summary>
		/// 删除数据表T_SPECIALLIST中的一条记录
		/// </summary>
	    /// <param name="SPECIALLISTID">SPECIALLISTID</param>
		/// <returns>影响的行数</returns>
		public int Delete(T_SPECIALLIST_Entity obj)
		{
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Delete(obj);
		}
		
		/// <summary>
		/// 根据 指定字段 指定值 ,删除符合条件的。
		/// </summary>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <returns>影响行数</returns>
		public int Delete(string Conditions)
		{				
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Delete(Conditions);
		}		
		
        /// <summary>
        /// 删除数据表的一表记录，根据 指定字段，指定值。
        /// </summary>
        /// <param name="Filed">字段</param>
        /// <param name="Value">值</param>
        /// <returns>影响行数</returns>
		public int Delete(string Field, string Value)
		{
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Delete(Field, Value);
			
		}
		
		/// <summary>
		/// 删除数据表T_SPECIALLIST中的一条记录
		/// </summary>
	    /// <param name="SPECIALLISTID">SPECIALLISTID</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>影响的行数</returns>
		public int Delete(T_SPECIALLIST_Entity obj, StringBuilder partitionName)
		{
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Delete(obj, partitionName);
		}
		
		/// <summary>
		/// 根据 指定字段 指定值 ,删除符合条件的。
		/// </summary>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>影响行数</returns>
		public int Delete(string Conditions, StringBuilder partitionName)
		{				
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Delete(Conditions, partitionName);
		}		
		
        /// <summary>
        /// 删除数据表的一表记录，根据 指定字段，指定值。
        /// </summary>
        /// <param name="Filed">字段</param>
        /// <param name="Value">值</param>
		/// <param name="partitionName">分区表名</param>
        /// <returns>影响行数</returns>
		public int Delete(string Field, string Value, StringBuilder partitionName)
		{
            CacheHelper.ClearSession("T_SPECIALLIST_List");
            CacheHelper.ClearCache("T_SPECIALLIST_List");
			return _dal.Delete(Field, Value, partitionName);
			
		}
		
		#endregion		
		
		#region 根据 指定字段 指定值，返回单个实体类
		/// <summary>
		/// 根据 指定字段 指定值 ,返回一个T_SPECIALLIST对象
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Value">字段值</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetEntity (string Field, string Value)
		{
			return _dal.GetEntity(Field, Value);
		}
		/// <summary>
		/// 根据 指定字段 指定值 ,返回一个T_SPECIALLIST对象
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Value">字段值</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetEntity (string Field, int Value)
		{
			return _dal.GetEntity(Field, Value.ToString());
		}
		/// <summary>
		/// 根据 指定字段 指定值 ,返回一个T_SPECIALLIST对象
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Value">字段值</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetEntity (string Field, long Value)
		{
			return _dal.GetEntity(Field, Value.ToString());
		}
		
		/// <summary>
		/// 根据 指定字段 指定值 ,返回一个T_SPECIALLIST对象
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Value">字段值</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetEntity (string Field, string Value, StringBuilder partitionName)
		{
			return _dal.GetEntity(Field, Value, partitionName);
		}
		/// <summary>
		/// 根据 指定字段 指定值 ,返回一个T_SPECIALLIST对象
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Value">字段值</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetEntity (string Field, int Value, StringBuilder partitionName)
		{
			return _dal.GetEntity(Field, Value.ToString(), partitionName);
		}
		/// <summary>
		/// 根据 指定字段 指定值 ,返回一个T_SPECIALLIST对象
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Value">字段值</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetEntity (string Field, long Value, StringBuilder partitionName)
		{
			return _dal.GetEntity(Field, Value.ToString(), partitionName);
		}
		#endregion 
				
		#region 返回实体类集合
		/// <summary>
		/// 得到数据表T_SPECIALLIST所有记录
		/// </summary>		
        /// <remarks>
        /// 示例:
        /// List＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List();
        /// </remarks>
		/// <returns>List＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList()
		{
			return _dal.GetList();
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// List＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <returns>List＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(string Conditions)
		{
			return _dal.GetList(Conditions);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// List＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="Sort">排序字段</param>
		/// <returns>List＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(string Conditions, string Sort)
		{
			return _dal.GetList(Conditions, Sort);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// List＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List(" and 1=1 ", 0, 10);
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="StartRecordIndex">记录开始</param>
		/// <param name="PageSize">页大小</param>
		/// <returns>List＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(string Conditions, int StartRecordIndex, int PageSize)
		{
			return _dal.GetList(Conditions, StartRecordIndex, PageSize);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// IList＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List(" and 1=1 ", 0, 10, "ID");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="StartRecordIndex">记录开始</param>
		/// <param name="PageSize">页大小</param>
		/// <param name="Sort">排序字段</param>
		/// <returns>IList＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(string Conditions, int StartRecordIndex, int PageSize, string Sort)
		{
			return _dal.GetList(Conditions, StartRecordIndex, PageSize, Sort);
		}
		
		/// <summary>
		/// 得到数据表T_SPECIALLIST所有记录
		/// </summary>		
        /// <remarks>
        /// 示例:
        /// List＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List();
        /// </remarks>
		/// <param name="partitionName">分区表名</param>
		/// <returns>List＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(StringBuilder partitionName)
		{
			return _dal.GetList(partitionName);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// List＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>List＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(string Conditions, StringBuilder partitionName)
		{
			return _dal.GetList(Conditions, partitionName);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// List＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="Sort">排序字段</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>List＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(string Conditions, string Sort, StringBuilder partitionName)
		{
			return _dal.GetList(Conditions, Sort, partitionName);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// List＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List(" and 1=1 ", 0, 10);
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="StartRecordIndex">记录开始</param>
		/// <param name="PageSize">页大小</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>List＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(string Conditions, int StartRecordIndex, int PageSize, StringBuilder partitionName)
		{
			return _dal.GetList(Conditions, StartRecordIndex, PageSize, partitionName);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// IList＜T_SPECIALLIST_Entity＞ list = T_SPECIALLIST_DAL.Get_T_SPECIALLIST_List(" and 1=1 ", 0, 10, "ID");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="StartRecordIndex">记录开始</param>
		/// <param name="PageSize">页大小</param>
		/// <param name="Sort">排序字段</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>IList＜T_SPECIALLIST_Entity＞对象集</returns>
		public List< T_SPECIALLIST_Entity> GetList(string Conditions, int StartRecordIndex, int PageSize, string Sort, StringBuilder partitionName)
		{
			return _dal.GetList(Conditions, StartRecordIndex, PageSize, Sort, partitionName);
		}
		#endregion 	
		
		#region 返回DataSet 对象
		/// <summary>
		/// 得到数据表T_SPECIALLIST所有记录
		/// </summary>		
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable();
        /// </remarks>
		/// <returns>DataSet集</returns>
		public DataTable GetDataTable()
		{			
			return _dal.GetDataTable();
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <returns>List< T_SPECIALLIST_Entity> 对象集</returns>
		public DataTable GetDataTable(string Conditions)
		{
			return _dal.GetDataTable(Conditions);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="Sort">排序字段</param>
		/// <returns>List< T_SPECIALLIST_Entity> 对象集</returns>
		public DataTable GetDataTable(string Conditions, string Sort)
		{
			return _dal.GetDataTable(Conditions, Sort);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable(" and 1=1 ", 0, 10);
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="StartRecordIndex">记录开始</param>
		/// <param name="PageSize">页大小</param>
		/// <returns>List< T_SPECIALLIST_Entity> 对象集</returns>
		public DataTable GetDataTable(string Conditions, int StartRecordIndex, int PageSize)
		{
			return _dal.GetDataTable(Conditions, StartRecordIndex, PageSize);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable(" and 1=1 ", 0, 10);
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="StartRecordIndex">记录开始</param>
		/// <param name="PageSize">页大小</param>
		/// <param name="Sort">排序字段</param>
		/// <returns>List< T_SPECIALLIST_Entity> 对象集</returns>
		public DataTable GetDataTable(string Conditions, int StartRecordIndex, int PageSize, string Sort)
		{
			return _dal.GetDataTable(Conditions, StartRecordIndex, PageSize, Sort);
		}
		
		/// <summary>
		/// 得到数据表T_SPECIALLIST所有记录
		/// </summary>		
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable();
        /// </remarks>
		/// <param name="partitionName">分区表名</param>
		/// <returns>DataSet集</returns>
		public DataTable GetDataTable(StringBuilder partitionName)
		{			
			return _dal.GetDataTable(partitionName);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>List< T_SPECIALLIST_Entity> 对象集</returns>
		public DataTable GetDataTable(string Conditions, StringBuilder partitionName)
		{
			return _dal.GetDataTable(Conditions, partitionName);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="Sort">排序字段</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>List< T_SPECIALLIST_Entity> 对象集</returns>
		public DataTable GetDataTable(string Conditions, string Sort, StringBuilder partitionName)
		{
			return _dal.GetDataTable(Conditions, Sort, partitionName);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable(" and 1=1 ", 0, 10);
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="StartRecordIndex">记录开始</param>
		/// <param name="PageSize">页大小</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>List< T_SPECIALLIST_Entity> 对象集</returns>
		public DataTable GetDataTable(string Conditions, int StartRecordIndex, int PageSize, StringBuilder partitionName)
		{
			return _dal.GetDataTable(Conditions, StartRecordIndex, PageSize, partitionName);
		}
		/// <summary>
		/// 得到符合条件的，数据表T_SPECIALLIST所有记录
		/// </summary>	
        /// <remarks>
        /// 示例:
        /// DataTable table = T_SPECIALLIST_DAL.GetDataTable(" and 1=1 ", 0, 10);
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="StartRecordIndex">记录开始</param>
		/// <param name="PageSize">页大小</param>
		/// <param name="Sort">排序字段</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>List< T_SPECIALLIST_Entity> 对象集</returns>
		public DataTable GetDataTable(string Conditions, int StartRecordIndex, int PageSize, string Sort, StringBuilder partitionName)
		{
			return _dal.GetDataTable(Conditions, StartRecordIndex, PageSize, Sort, partitionName);
		}
		#endregion 		
		
		#region 查询实体总数
		/// <summary>
        /// 查询实体数
        /// </summary>	
        /// <remarks>
        /// 示例:
        /// int val = T_SPECIALLIST_DAL.GetCount();
        /// </remarks>
        /// <returns>实体的总数</returns>
		public long GetCount()
		{
			return _dal.GetCount();
		}
		
		/// <summary>
        /// 查询符合条件的实体总数
        /// </summary>		
        /// <remarks>
        /// 示例:
        /// int val = T_SPECIALLIST_DAL.GetCount(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
        /// <returns>实体的总数</returns>
		public long GetCount(string Conditions)
		{
			return _dal.GetCount(Conditions);
		}
		
		/// <summary>
        /// 查询实体数
        /// </summary>	
        /// <remarks>
        /// 示例:
        /// int val = T_SPECIALLIST_DAL.GetCount();
        /// </remarks>
		/// <param name="partitionName">分区表名</param>
        /// <returns>实体的总数</returns>
		public long GetCount(StringBuilder partitionName)
		{
			return _dal.GetCount(partitionName);
		}
		
		/// <summary>
        /// 查询符合条件的实体总数
        /// </summary>		
        /// <remarks>
        /// 示例:
        /// int val = T_SPECIALLIST_DAL.GetCount(" and 1=1 ");
        /// </remarks>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="partitionName">分区表名</param>
        /// <returns>实体的总数</returns>
		public long GetCount(string Conditions, StringBuilder partitionName)
		{
			return _dal.GetCount(Conditions, partitionName);
		}
		#endregion 		
		
		#region 检测是否存在		
		/// <summary>
        /// 检测记录是否存在
        /// </summary>
        /// <param name="Field"></param>
        /// <param name="Value"></param>
        /// <returns></returns>
        public int IsExist(string Field, string Value)
        {
            return _dal.IsExist(Field, Value);
        }
		/// <summary>
        /// 检测记录是否存在
        /// </summary>
        /// <param name="Field"></param>
        /// <param name="Value"></param>
		/// <param name="partitionName">分区表名</param>
        /// <returns></returns>
        public int IsExist(string Field, string Value, StringBuilder partitionName)
        {
            return _dal.IsExist(Field, Value, partitionName);
        }
		#endregion 		
		
		#region 获取 指定字段的 最大值
		/// <summary>
		/// 获取 指定字段的 返回 最大值
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <returns>最大值</returns>		
		public string GetMaxValue(string Field)
		{
			return _dal.GetMaxValue(Field);
		}
		/// <summary>
		/// 获取 指定字段的 返回 最大值
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <returns>最大值</returns>		
		public string GetMaxValue(string Field, string Conditions)
		{
			return _dal.GetMaxValue(Field, Conditions);
		}
		
		/// <summary>
		/// 获取 指定字段的 返回 最大值
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>最大值</returns>		
		public string GetMaxValue(string Field, StringBuilder partitionName)
		{
			return _dal.GetMaxValue(Field, partitionName);
		}
		/// <summary>
		/// 获取 指定字段的 返回 最大值
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>最大值</returns>		
		public string GetMaxValue(string Field, string Conditions, StringBuilder partitionName)
		{
			return _dal.GetMaxValue(Field, Conditions, partitionName);
		}
		#endregion
		
		#region 获取 指定字段的 最小值
		/// <summary>
		/// 获取 指定字段的 返回 最小值
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <returns>最小值</returns>		
		public string GetMinValue(string Field)
		{
			return _dal.GetMinValue(Field);
		}
		/// <summary>
		/// 获取 指定字段的 返回 最小值
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <returns>最小值</returns>		
		public string GetMinValue(string Field, string Conditions)
		{
			return _dal.GetMinValue(Field, Conditions);
		}
		
		/// <summary>
		/// 获取 指定字段的 返回 最小值
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>最小值</returns>		
		public string GetMinValue(string Field, StringBuilder partitionName)
		{
			return _dal.GetMinValue(Field, partitionName);
		}
		/// <summary>
		/// 获取 指定字段的 返回 最小值
		/// </summary>
		/// <param name="Field">字段名</param>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>最小值</returns>		
		public string GetMinValue(string Field, string Conditions, StringBuilder partitionName)
		{
			return _dal.GetMinValue(Field, Conditions, partitionName);
		}
		#endregion		
		
		#region 获取 指定字段的  唯一行
		/// <summary>
		/// 获取 指定字段的 返回 唯一行
		/// </summary>
		/// <param name="Fields">字段名 多个字段 用"," 分隔 </param>
		/// <returns>结果集中的唯一行</returns>
		public DataTable GetDistinctTable(string Fields)
		{
			return _dal.GetDistinctTable(Fields);
		}
		/// <summary>
		/// 获取 指定字段的 返回 唯一行
		/// </summary>
		/// <param name="Fields">字段名 多个字段 用"," 分隔 </param>
		/// <returns>结果集中的唯一行</returns>
		public DataTable GetDistinctTable(string Fields, string Conditions)
		{
			return _dal.GetDistinctTable(Fields, Conditions);
		}
		
		/// <summary>
		/// 获取 指定字段的 返回 唯一行
		/// </summary>
		/// <param name="Fields">字段名 多个字段 用"," 分隔 </param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>结果集中的唯一行</returns>
		public DataTable GetDistinctTable(string Fields, StringBuilder partitionName)
		{
			return _dal.GetDistinctTable(Fields, partitionName);
		}
		/// <summary>
		/// 获取 指定字段的 返回 唯一行
		/// </summary>
		/// <param name="Fields">字段名 多个字段 用"," 分隔 </param>
		/// <param name="Conditions">Where条件，不需写“Where”</param>
		/// <param name="partitionName">分区表名</param>
		/// <returns>结果集中的唯一行</returns>
		public DataTable GetDistinctTable(string Fields, string Conditions, StringBuilder partitionName)
		{
			return _dal.GetDistinctTable(Fields, Conditions, partitionName);
		}
		#endregion		
		
		#region 检测表是否存在
		/// <summary>
        /// 根据表名 检测表是否存在 （精确查询）
        /// </summary>
        /// <param name="TableName">表名</param>
        /// <returns>是/否</returns>
		public bool IsExistTable()
		{
			return _dal.IsExistTable();
		}
		
		/// <summary>
        /// 根据表名 查询符合条件的 表信息 （模糊查询） 
        /// </summary>
        /// <param name="TableName">表名</param>
        /// <returns></returns>
		public DataTable GetTableList(string TableName)
		{
			return _dal.GetTableList(TableName);
		}
		
		#endregion
		
				
		#region 检测字段是否存在
		/// <summary>
        /// 根据字段名 检测字段是否存在 （精确查询）
        /// </summary>
        /// <param name="FieldName">字段名</param>
        /// <returns>是/否</returns>
		public bool IsExistField(string FieldName)
		{
			return _dal.IsExistField(FieldName);
		}
		
		/// <summary>
        /// 根据字段名 查询符合条件的 字段信息 （模糊查询） 
        /// </summary>
        /// <param name="FieldName">字段名</param>
        /// <returns></returns>
		public DataTable GetFieldList(string FieldName)
		{
			return _dal.GetFieldList(FieldName);
		}
		
		#endregion
		
		#region 缓存
		#region Session
		/// <summary>
		/// 得到数据表T_SPECIALLIST所有缓存记录
        /// 缓存 会 缓存 表的全部数据到 程序内存中。对于记录 量大的表请勿使用些方法。
		/// </summary>
        /// <param name="page">当前页面对象</param>
		///<returns></returns>
		public List< T_SPECIALLIST_Entity> GetSession_T_SPECIALLIST_List(Page page)
		{
			List< T_SPECIALLIST_Entity> list = CacheHelper.GetSession("T_SPECIALLIST_List") as List< T_SPECIALLIST_Entity>;
			if (list == null)
			{
				list = _dal.GetList("") as List< T_SPECIALLIST_Entity>;
				CacheHelper.SetSession("T_SPECIALLIST_List", list);
			}
			return list;
		}
		/// <summary>
		/// 根据主键 ID ,查询缓存返回一个T_SPECIALLIST对象
        /// 缓存 会 缓存 表的全部数据到 程序内存中。对于记录 量大的表请勿使用些方法。
		/// </summary>
        /// <param name="page">当前页面对象</param>
		/// <param name="sPECIALLISTID">sPECIALLISTID</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetSession_T_SPECIALLIST_EntityByKey (Page page, int sPECIALLISTID)
		{
			List< T_SPECIALLIST_Entity> list = GetSession_T_SPECIALLIST_List(page);
            T_SPECIALLIST_Entity entity = list.Find(delegate(T_SPECIALLIST_Entity en) { if (en.SPECIALLISTID == sPECIALLISTID) return true; else return false; });

            return entity;
		}
		
		#endregion
		
		#region PageItem
		/// <summary>
		/// 得到数据表T_SPECIALLIST所有缓存记录
        /// 缓存 会 缓存 表的全部数据到 程序内存中。对于记录 量大的表请勿使用些方法。
		/// </summary>
        /// <param name="page">当前页面对象</param>
		///<returns></returns>
		public List< T_SPECIALLIST_Entity> GetPageItem_T_SPECIALLIST_List(Page page)
		{
			List< T_SPECIALLIST_Entity> list = CacheHelper.GetPageItem(page, "T_SPECIALLIST_List") as List< T_SPECIALLIST_Entity>;
			if (list == null)
			{
				list = _dal.GetList("") as List< T_SPECIALLIST_Entity>;
				CacheHelper.SetPageItem(page, "T_SPECIALLIST_List", list);
			}
			return list;
		}
		/// <summary>
		/// 根据主键 ID ,查询缓存返回一个T_SPECIALLIST对象
        /// 缓存 会 缓存 表的全部数据到 程序内存中。对于记录 量大的表请勿使用些方法。
		/// </summary>
        /// <param name="page">当前页面对象</param>
		/// <param name="sPECIALLISTID">sPECIALLISTID</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetPageItem_T_SPECIALLIST_EntityByKey (Page page, int sPECIALLISTID)
		{
			List< T_SPECIALLIST_Entity> list = GetPageItem_T_SPECIALLIST_List(page);
            T_SPECIALLIST_Entity entity = list.Find(delegate(T_SPECIALLIST_Entity en) { if (en.SPECIALLISTID == sPECIALLISTID) return true; else return false; });

            return entity;
		}
		
		#endregion		
		
		#region Cache
		/// <summary>
		/// 得到数据表T_SPECIALLIST所有缓存记录
        /// 缓存 会 缓存 表的全部数据到 程序内存中。对于记录 量大的表请勿使用些方法。
		/// </summary>
        /// <param name="page">当前页面对象</param>
		///<returns></returns>
		public List< T_SPECIALLIST_Entity> GetCache_T_SPECIALLIST_List(Page page)
		{
			List< T_SPECIALLIST_Entity> list = CacheHelper.GetCache("T_SPECIALLIST_List") as List< T_SPECIALLIST_Entity>;
			if (list == null)
			{
				list = _dal.GetList("") as List< T_SPECIALLIST_Entity>;
				CacheHelper.SetCache("T_SPECIALLIST_List", list);
			}
			return list;
		}
		/// <summary>
		/// 根据主键 ID ,查询缓存返回一个T_SPECIALLIST对象
        /// 缓存 会 缓存 表的全部数据到 程序内存中。对于记录 量大的表请勿使用些方法。
		/// </summary>
        /// <param name="page">当前页面对象</param>
		/// <param name="sPECIALLISTID">sPECIALLISTID</param>
		/// <returns>T_SPECIALLIST_Entity 对象</returns>
		public T_SPECIALLIST_Entity GetCache_T_SPECIALLIST_EntityByKey (Page page, int sPECIALLISTID)
		{
			List< T_SPECIALLIST_Entity> list = GetCache_T_SPECIALLIST_List(page);
            T_SPECIALLIST_Entity entity = list.Find(delegate(T_SPECIALLIST_Entity en) { if (en.SPECIALLISTID == sPECIALLISTID) return true; else return false; });

            return entity;
		}
		
		#endregion
		#endregion

        #endregion
		
		#region 自定义实例化函数

        /// <summary>
        /// 更新客户特殊标志
        /// 黑名单、红名单、
        /// Updates the special list.
        /// </summary>
        /// <param name="cEntity">The c entity.</param>
        /// <param name="type">The type.</param>
        /// <param name="_userLoginInfo">The _user login info.</param>
        /// <param name="phone">The phone.</param>
        /// <returns></returns>
        public bool UpdateSpecialList(T_CUSTOMER_Entity cEntity,  CustomerSpecialType type, UserLoginInfo _userLoginInfo, string phone)
        {
            bool rel = false;
            try
            {
                Delete("CustomerID", cEntity.CUSTOMERID);
                if (type != CustomerSpecialType.正常名单)
                {
                    T_SPECIALLIST_Entity entity;
                    List<String> tels = new List<string>();
                    if(!String.IsNullOrEmpty(phone))
                    {
                        tels.Add(phone);
                    }
                    if (!tels.Exists(delegate(string tel) { if (cEntity.MOBILEPHONE.Length <= 10 && tel.ToLower() == cEntity.MOBILEPHONE.Trim().ToLower()) return true; else return false; }))
                    {
                        tels.Add(cEntity.MOBILEPHONE.Trim().ToLower());
                    }
                    if (!tels.Exists(delegate(string tel) { if (cEntity.HOMEPHONE.Length <= 10 && tel.ToLower() == cEntity.HOMEPHONE.Trim().ToLower()) return true; else return false; }))
                    {
                        tels.Add(cEntity.HOMEPHONE.Trim().ToLower());
                    }
                    if (!tels.Exists(delegate(string tel) { if (cEntity.FIRSTCONTACTTEL.Length <= 10 && tel.ToLower() == cEntity.FIRSTCONTACTTEL.Trim().ToLower()) return true; else return false; }))
                    {
                        tels.Add(cEntity.FIRSTCONTACTTEL.Trim().ToLower());
                    }
                    if (tels.Count > 0)
                    {
                        foreach (string tel in tels)
                        {
                            entity = new T_SPECIALLIST_Entity();
                            entity.BUSINESSDIVISIONCODE = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.BUSINESSDIVISIONCODE : "";
                            entity.BUSINESSDIVISIONID = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.BUSINESSDIVISIONID : 0;
                            entity.BUSINESSDIVISIONNAME = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.BUSINESSDIVISIONNAME : "";
                            entity.CREATEPEOPLE = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.CREATEPEOPLE : "";
                            entity.CREATEPEOPLEID = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.CREATEPEOPLEID : 0;
                            entity.CREATETIME = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.CREATETIME : null;
                            entity.LASTMODIFYPEOPLE = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.LASTMODIFYPEOPLE : "";
                            entity.LASTMODIFYPEOPLEID = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.LASTMODIFYPEOPLEID : 0;
                            entity.LASTMODIFYTIME = (_userLoginInfo.UserEntity != null) ? _userLoginInfo.UserEntity.LASTMODIFYTIME : null;
                            entity.STATUS = (int)Status.启用;
                            entity.CUSTOMERID = cEntity.CUSTOMERID;
                            entity.CUSTOMERNAME = cEntity.CUSTOMERNAME;
                            entity.CUSTOMERTYPE = (int)type;
                            entity.PHONE = tel;
                            Insert(entity);
                        }
                    }
                }
                return true;
            }
            catch
            {
                return false;
            }
        }


		
		#endregion
    }
}
